﻿<cfsilent>

	<cfset sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice") />
	<cfset depId = sessionAdvice.getUserProp("teacherDepartment") />
 
    <cfset sql = "  SELECT a.institute_id,a.institute_name 
					FROM t_institute a
					WHERE a.institute_id = :depId "/>
                    
    <cfset queryObj = new Query( datasource=application.dnsSlave ) />
    <cfset queryObj.addParam( name="depId", value=depId, cfsqltype="cf_sql_varchar" )/>
    
    <cfset rs_department = queryObj.execute( sql=sql ).getResult()/>
  
	<cfset sql = "  SELECT a.sbj_id,a.sbj_name,
						   a.institute_id,a.subject_code,
						   a.sbj_short,a.level_code,
						   a.term_start,a.sbj_english,
						   a.b_id,a.schooling_length 
					FROM t_subject a 
					WHERE a.sbj_id = :SubID "/>
                    
   	<cfset queryObj = new Query( datasource=application.dnsSlave ) />
    <cfset queryObj.addParam( name="SubID", value=event.getArg("SubID"), cfsqltype="cf_sql_varchar" )/>
    
	<cfset rs_subject = queryObj.execute( sql=sql ).getResult()/>
    
    <cfset sql = "  SELECT a.b_id,a.learning_branch 
					FROM t_learning_branch a 
					ORDER BY a.b_id ASC "/>
                    
   	<cfset queryObj = new Query( datasource=application.dnsSlave ) />
	<cfset rs_branch = queryObj.execute( sql=sql ).getResult()/>
     
    <cfset sql = "  SELECT a.sbj_id,a.sbj_direction,
						   a.sbj_name,a.sbj_short,
						   a.sbj_english 
					FROM t_subject a 
					WHERE a.sbj_id LIKE :parent 
					ORDER BY a.sbj_id ASC "/>
                    
   	<cfset queryObj = new Query( datasource=application.dnsSlave ) />
    <cfset queryObj.addParam( name="parent", value=rs_subject.sbj_id & '_', cfsqltype="cf_sql_varchar" )/>
    
	<cfset rs_dir = queryObj.execute( sql=sql ).getResult()/>
     
    <cfset sql = "  SELECT a.campus_id,a.campus_name 
					FROM t_campus a 
					ORDER BY a.campus_id ASC "/>
                    
   	<cfset queryObj = new Query( datasource=application.dnsSlave ) />
	<cfset rs_campus = queryObj.execute( sql=sql ).getResult()/>
 
    <cfset sql = "  SELECT a.grade, count(a.cls_id) cls_id, sum(a.cls_size) cls_size, sum(a.cls_scale) cls_scale  
					FROM t_class a 
					WHERE a.sbj_id = :SubID 
					GROUP BY a.grade 
					ORDER BY a.grade DESC "/>
                    
	<cfset queryObj = new Query( datasource=application.dnsSlave ) />
    <cfset queryObj.addParam( name="SubID", value=event.getArg("SubID"), cfsqltype="cf_sql_varchar" )/>
    
	<cfset rs_grade = queryObj.execute( sql=sql ).getResult()/>
    
	<cfset event.setArg("pageTitle", "教学运行基础数据 - 行政建制 - 专业概况 - " & rs_subject.sbj_name) />

	<cfset targetArgs = structNew() />
	<cfset structInsert(targetArgs, "DepID", rs_department.institute_id, true) />
	<cfset structInsert(targetArgs, "SubID", rs_subject.sbj_id, true) />

	<cfset currentTab = event.getArg("TabID", "labDirection") />

</cfsilent> 
<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('instituteSetting', targetArgs)#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText"><cfoutput>#rs_department.institute_name#</cfoutput>概况</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 card"></i><cfoutput>#rs_subject.sbj_name#</cfoutput>专业概况
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labBaseInfo">class="active"</cfif> id="labBaseInfo" tabTarget="BaseInfo">专业基础信息</span>
						<span <cfif currentTab eq "labDirection">class="active"</cfif> id="labDirection" tabTarget="Direction">专业方向设置</span>
						<span <cfif currentTab eq "labFormClass">class="active"</cfif> id="labFormClass" tabTarget="FormClass">行政班建制</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="BaseInfo" class="tabContent">
					
					<cfif currentTab eq "labBaseInfo">
						<div class="systemNotice">
							<h3><span class="img icon16x16 info"></span>专业基础数据已更新</h3>
							<p>你可以通过上面的标签切换, 分别查阅到专业下设的专业主修方向信息以及课程体系设置概况.</p>
						</div>
					</cfif>
					
					<form id="formEdit" onSubmit="javascript:return processVerfiyForm('formEdit');" class="formWrapper" method="post" action="<cfoutput>#buildURL('subjectUpdateDo')#</cfoutput>">
						
						<input type="hidden" name="SubjectID" value="<cfoutput>#rs_subject.sbj_id#</cfoutput>" />
						<input type="hidden" name="InstituteID" value="<cfoutput>#rs_subject.institute_id#</cfoutput>" />
						
						<div class="label">
							<span class="req">*</span><b>专业正式名称</b>
							<input name="SubjectName" id="SubjectName" type="text" class="typeTextShort" verification="required" maxlength="30" value="<cfoutput>#event.getArg('SubjectName', rs_subject.sbj_name)#</cfoutput>" />
						</div>
						
						<div class="label">
							<span class="req">*</span><b>国家专业代码</b>
							<input name="SubjectCode" id="SubjectCode" type="text" class="typeCode" verification="required" maxlength="6" value="<cfoutput>#event.getArg('SubjectCode', rs_subject.subject_code)#</cfoutput>" />
							<p class="notice">国家专业代码请参阅教育部标准 JB/BSSZY-2006 《授予博士、硕士学位和培养研究生的学科、专业代码》规范填写</p>
						</div>
						
						<div class="label">
							<span class="req">*</span><b>专业简称</b>
							<input name="SubjectShortName" id="SubjectShortName" type="text" class="typeTextTiny" verification="required" maxlength="10" value="<cfoutput>#event.getArg('SubjectShortName', rs_subject.sbj_short)#</cfoutput>" />
						</div>
											
						<div class="label">
							<b>培养层次</b>
							<input name="StudentLevel" type="radio" class="typeRadio" value="3" <cfif event.getArg('StudentLevel', rs_subject.level_code) eq "3">checked="checked"</cfif> />本科
							<input name="StudentLevel" type="radio" class="typeRadio" value="4" <cfif event.getArg('StudentLevel', rs_subject.level_code) eq "4">checked="checked"</cfif> />专业
						</div>
						
						<div class="label">
							<b>招生学期</b>
							<input name="TermStart" type="radio" class="typeRadio" value="1" <cfif event.getArg('TermStart', rs_subject.term_start) eq "1">checked="checked"</cfif> />秋季
							<input name="TermStart" type="radio" class="typeRadio" value="2" <cfif event.getArg('TermStart', rs_subject.term_start) eq "2">checked="checked"</cfif> />春季
						</div>
						
						<hr/>
						
						<div class="label">
							<b>英文名称</b>
							<input name="SubjectEnglish" id="SubjectEnglish" type="text" class="typeText typeEnglish" maxlength="180" value="<cfoutput>#event.getArg('SubjectEnglish', rs_subject.sbj_english)#</cfoutput>" />
						</div>
						
						<div class="label">
							<b>学科门类</b>
							<select name="LearningBranch"> 
                                <cfloop query="rs_branch">
									<option <cfif event.getArg('LearningBranch', rs_subject.b_id) eq rs_branch.b_id>selected="selected"</cfif> value="<cfoutput>#rs_branch.b_id#</cfoutput>"><cfoutput>#rs_branch.learning_branch#</cfoutput></option>
								</cfloop>
							</select>
						</div>
						
						<div class="label">
							<b>学制</b>
							<input name="SchoolingLength" type="radio" class="typeRadio" value="2.5" <cfif event.getArg('SchoolingLength', rs_subject.schooling_length) eq 2.5>checked="checked"</cfif>/>两年半
							<input name="SchoolingLength" type="radio" class="typeRadio" value="3" <cfif event.getArg('SchoolingLength', rs_subject.schooling_length) eq 3>checked="checked"</cfif>/>三年
							<input name="SchoolingLength" type="radio" class="typeRadio" value="4" <cfif event.getArg('SchoolingLength', rs_subject.schooling_length) eq 4>checked="checked"</cfif>/>四年
							<input name="SchoolingLength" type="radio" class="typeRadio" value="5" <cfif event.getArg('SchoolingLength', rs_subject.schooling_length) eq 5>checked="checked"</cfif>/>五年
							<input name="SchoolingLength" type="radio" class="typeRadio" value="7" <cfif event.getArg('SchoolingLength', rs_subject.schooling_length) eq 7>checked="checked"</cfif>/>七年
						</div>
						
						<hr/>
						
						<div class="lable">
							<input class="button" type="submit" value="提交" />
							<input class="button" type="reset" value="重设表格" />
						</div>
					</form>
					
				</div>
				
				<div id="Direction" class="tabContent">
					
					<cfif rs_dir.recordCount>
							<div class="noticeBlock">
								<h3><cfoutput>#rs_subject.sbj_name#</cfoutput>专业主修方向</h3>
								<p><span class="img icon16x16 message"></span>这里列出的是<cfoutput>#rs_subject.sbj_name#</cfoutput>专业下设的学生修读学科方向. 如果您需要设置新的主修专业方向, <a href="javascript:showCreateFrom();">可以通过点击这里进行</a></p>
								<hr/>
							</div>
							
							<script language="javascript" type="text/javascript">
								//<![CDATA[
								<!--
								function showCreateFrom() {
									$("form#formCreate").toggleClass("hidden_elem");
									return void(0);
								}
								// -->
								//]]>				
							</script>
						
							<div class="clearfix">
								
								<cfset row = 0 />
								<table id="directGrid" class="UIEditable">
									<thead>
										<tr>
											<td></td>
											<td>专业方向</td>
											<td>简称</td>
											<td>英文</td>
											<td></td>
										</tr>
									</thead>
									<tbody> 
                                    <cfloop query="rs_dir">
										<cfset row++ />
										<tr class="editRows" rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>">
											<td width="20">
												<div class="deactive index forDelete">
													<cfoutput>#rs_dir.sbj_direction#</cfoutput>
												</div>
												<div class="active">
													<a href="javascript:void(0);" class="stat delete" rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>"></a>
												</div>
											</td>
											<td width="200">
												<div class="deactive forSubjectName">
													<cfoutput>#rs_dir.sbj_name#</cfoutput>
												</div>
												<div class="active">
													<input style="width:150px;" class="activeTextAuto" rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>" name="SubjectName" type="text" value="<cfoutput>#rs_dir.sbj_name#</cfoutput>" />
												</div>
											</td>
											<td width="80">
												<div class="deactive forSubjectShortName">
													<cfoutput>#rs_dir.sbj_short#</cfoutput>
												</div>
												<div class="active">
													<input style="width:60px;" class="activeTextAuto" rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>" name="SubjectShortName" type="text" value="<cfoutput>#rs_dir.sbj_short#</cfoutput>" />
												</div>
											</td>
											<td>
												<div class="deactive forSubjectEnglish">
													<span class="english"><cfoutput>#rs_dir.sbj_english#</cfoutput></span>
												</div>
												<div class="active">
													<input style="width:300px;" class="activeTextAuto" rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>" name="SubjectEnglish" type="text" value="<cfoutput>#rs_dir.sbj_english#</cfoutput>" />
												</div>
											</td>
											<td width="18">
												<span rowid="<cfoutput>#rs_dir.sbj_id#</cfoutput>" class="stat saved"></span>
											</td>
										</tr>
									</cfloop>
									</tbody>
								</table>
								
								<script language="javascript" type="text/javascript">
									//<![CDATA[
									<!--
									$(document).ready(function() {
										
										/* init inlineEdit */
										$("tr.editRows", "#directGrid.UIEditable").each(function(index, element) {
											
											$(this).dblclick(function(e) {
								
												var $row = $(this);
												var rowid = $row.attr("rowid");
								
												$("div.deactive", $row).hide("fast", function(){
													$("div.active", $row).show("fast");
												});

												$("span.stat", $row).removeClass("saved").addClass("save");
											});
											
										});
										
										/* form element blur reset */
										$("span.stat", "#directGrid.UIEditable tr.editRows").click(function(){
											
											var rowid = $(this).attr("rowid");
											var $row = $("tr.editRows[rowid='" + rowid + "']", "#directGrid.UIEditable");
							
											$("span.stat", $row).removeClass("waiting").removeClass("save").removeClass("checked").addClass("saved");
										
											$("div.active", $row).hide("fast", function(){
												$("div.deactive", $row).show("fast");								
											});
											
										});
										
										
										/* form delete trigger */
										$("a.delete", "#directGrid.UIEditable tr.editRows").click(function(){
											
											var rowid = $(this).attr("rowid");
											
											$.post(
													"<cfoutput>#buildURL('apiDirectionDelete')#</cfoutput>", 
													{
														'SubjectID' : rowid,
														'seed': (new Date()).getTime()
													}, 
													function(data) {
														
														result = $.parseJSON(data);
														
														var rowid = result.SubjectID;
														var $row = $("tr.editRows[rowid='" + rowid + "']", "#directGrid.UIEditable");
														
														$row.hide();
													});
											
											
										});
										
										/* form element trigger */
										$(":input", "#directGrid.UIEditable tr.editRows").change(function(e) {
										
											var rowid = $(this).attr("rowid");
											var $row = $("tr.editRows[rowid='" + rowid + "']", "#directGrid.UIEditable");
											
											if ($(this).val()) {
												$("span.stat", $row).removeClass("checked").removeClass("save").removeClass("info").addClass("waiting");
											
												/* parse field */
												var editedSubjectName = $(":input[name='SubjectName']", $row).val();
												var editedSubjectShortName = $(":input[name='SubjectShortName']", $row).val();
												var editedSubjectEnglish = $(":input[name='SubjectEnglish']", $row).val();
												
												$.post(
														"<cfoutput>#buildURL('apiDirectionUpdate')#</cfoutput>", 
														{
																'SubjectID' : rowid,
																'SubjectName' : editedSubjectName,
																'SubjectShortName' : editedSubjectShortName,
																'SubjectEnglish' : editedSubjectEnglish,
																'seed': (new Date()).getTime()
														}, 
														function(data) {
															
															result = $.parseJSON(data);
														
															var rowid = result.SubjectID;
															var $row = $("tr.editRows[rowid='" + rowid + "']", "#directGrid.UIEditable");
															
															var newSubjectName = result.SubjectName;
															var newSubjectShortName = result.SubjectShortName;
															var newSubjectEnglish = result.SubjectEnglish;
															
															$("div.forSubjectName", $row).text(newSubjectName);
															$("div.forSubjectShortName", $row).text(newSubjectShortName);
															$("div.forSubjectEnglish", $row).text(newSubjectEnglish);
															
															$("span.stat", $row).removeClass("waiting").addClass("save");
															
															$("div.active", $row).hide("fast", function(){
																$("div.deactive", $row).show("fast");								
															});
															
														});
												
											}
											else {
												$("span.stat", $row).removeClass("save").addClass("info");
											}
										
										});
										
									});
									// -->
									//]]>
								</script>
							</div>
						<cfelse>
							<div class="systemNotice">
								<h3><span class="img icon16x16 info"></span>尚未设置专业主修方向</h3>
								<p>当前您还没有设置<cfoutput>#rs_subject.sbj_name#</cfoutput>专业的主修方向分支, 请通过完善下列表单设置该专业的第一个主修分支.</p>
							</div>
					</cfif>
					
					<form id="formCreate" onSubmit="javascript:return processVerfiyForm('formCreate');" class="formWrapper <cfif rs_dir.recordCount>hidden_elem</cfif>" method="post" action="<cfoutput>#buildURL('directionCreateDo')#</cfoutput>">
						
						<input type="hidden" name="SubjectID" value="<cfoutput>#rs_subject.sbj_id#</cfoutput>" />
						
						<div class="label">
							<span class="req">*</span><b>专业方向</b>
							<input name="DirectionName" id="DirectionName" type="text" class="typeTextShort" verification="required" maxlength="30" value="<cfoutput>#event.getArg('DirectionName')#</cfoutput>" />
						</div>
						
						<div class="label">
							<span class="req">*</span><b>专业方向简称</b>
							<input name="DirectionShortName" id="DirectionShortName" type="text" class="typeTextTiny" verification="required" maxlength="10" value="<cfoutput>#event.getArg('DirectionShortName')#</cfoutput>" />
						</div>
						
						<div class="label">
							<b>英文名称</b>
							<input name="DirectionEnglish" id="DirectionEnglish" type="text" class="typeText typeEnglish" maxlength="180" value="<cfoutput>#event.getArg('DirectionEnglish')#</cfoutput>" />
						</div>
						
						<hr/>
						
						<div class="lable">
							<input class="button" type="submit" value="提交" />
							<input class="button" type="reset" value="重设表格" />
						</div>
					
					</form>
					
				</div>
				
				<div id="FormClass" class="tabContent">
					
					<cfif rs_grade.recordCount>
						<div id="classTables">
							<cfset arrayidx = 0 /> 
                            <cfloop query="rs_grade">
								<cfset arrayidx++/>
								<div class="noticeBlock">
									<cfif arrayidx eq 1>
									<div class="operation">
										<a class="uiButton uiButtonSpecial" href="<cfoutput>#buildURL('classDownloadExcel', targetArgs)#</cfoutput>"><i class="mrs img btnDownload"></i><span class="uiButtonText">下载班级数据</span></a>
									</div>
									</cfif>
									<h3><cfoutput>#rs_grade.grade#</cfoutput>级</h3>
									<p><span class="img icon16x16 message"></span>共计<em><cfoutput>#rs_grade.cls_id#</cfoutput></em>个行政班, 计划招生规模<em><cfoutput>#rs_grade.cls_size#</cfoutput></em>人, 实际学生人数<em><cfoutput>#rs_grade.cls_scale#</cfoutput></em>.</p>
									<hr/>
								</div>
								 
								<cfset sql = "  SELECT a.cls_id,a.cls_name,
													   t_campus.campus_name,a.campus_id,
													   a.cls_size,a.cls_scale
												FROM t_class a 
													 INNER JOIN t_campus ON a.campus_id = t_campus.campus_id 
												WHERE a.sbj_id = :subjectId 
													  AND 
													  a.grade = :Grade 
											    ORDER BY a.cls_name ASC"/>
								<cfset queryObj = new Query( datasource=application.dnsSlave ) />
								<cfset queryObj.addParam( name="subjectId", value=event.getArg("SubID"), cfsqltype="cf_sql_varchar" )/>
                                <cfset queryObj.addParam( name="Grade", value=rs_grade.grade, cfsqltype="cf_sql_char" )/>
								<cfset rs_class = queryObj.execute( sql=sql ).getResult()/> 
								<cfset row = 0 />
								<table class="UIEditable">
									<thead>
										<tr>
											<td width="18"></td>
											<td>班级</td>
											<td width="120">所在校区</td>
											<td width="60" align="center">计划人数</td>
											<td width="60" align="center">学生数</td>
											<td width="18"></td>
										</tr>
									</thead>
									<tbody> 
                                    <cfloop query="rs_class">
											
										<cfset row++ />
											
										<tr class="editRows" rowid="<cfoutput>#rs_class.cls_id#</cfoutput>">
											<td>
												<div class="deactive index forDelete">
													<cfoutput>#numberFormat(row, '0_')#</cfoutput>
												</div>
												
											</td>
											<td>
												<div class="deactive" forField="Name"><cfoutput>#rs_class.cls_name#</cfoutput></div>
												<div class="active" forField="Name">
													<input style="width:120px;" forField="Name" class="activeTextAuto" rowid="<cfoutput>#rs_class.cls_id#</cfoutput>" type="text" value="<cfoutput>#rs_class.cls_name#</cfoutput>" />
												</div>
											</td>
											<td>
												<div class="deactive" forField="CampusID"><cfoutput>#rs_class.campus_name#</cfoutput></div>
												<div class="active" forField="CampusID">
													<select forField="CampusID" class="activeSelectAuto" rowid="<cfoutput>#rs_class.cls_id#</cfoutput>"> 
                                                        <cfloop query="rs_campus">
															<option <cfif rs_campus.campus_id eq rs_class.campus_id>selected="selected"</cfif> value="<cfoutput>#rs_campus.campus_id#</cfoutput>"><cfoutput>#rs_campus.campus_name#</cfoutput></option>
														</cfloop>
													</select>
												</div>
											</td>
											<td align="center">
												<div class="deactive" forField="PlanSize"><span class="numeric"><cfoutput>#rs_class.cls_size#</cfoutput></span></div>
												<div class="active" forField="PlanSize">
													<input style="width:40px;" forField="PlanSize" class="activeTextAuto" rowid="<cfoutput>#rs_class.cls_id#</cfoutput>" type="text" maxlength="3" value="<cfoutput>#rs_class.cls_size#</cfoutput>" />
												</div>
											</td>
											<td align="center">
												<span class="numeric"><cfoutput>#rs_class.cls_scale#</cfoutput></span>
											</td>
											<td>
												<span rowid="<cfoutput>#rs_class.cls_id#</cfoutput>" class="stat saved"></span>
											</td>
										</tr>
											
									</cfloop>
									</tbody>
								</table>
								
							</cfloop>
						</div>	
						
							<script language="javascript" type="text/javascript">
								//<![CDATA[
								<!--
								$(document).ready(function() {
								
									var $div = $("div#classTables");
								
									$("tr.editRows", $div).dblclick(function(e) {
									
										var rowid = $(this).attr("rowid");
										var $row = $("tr.editRows[rowid='" + rowid + "']", $div);
										
										$("div.deactive", $row).hide("fast", function(){
											$("div.active", $row).show("fast");
										});
										
										$("span.stat", $row).removeClass("saved").addClass("save");
									
									});
									
									/* form element blur reset */
									$("span.stat", $div).click(function(){
											
										var rowid = $(this).attr("rowid");
										var $row = $("tr.editRows[rowid='" + rowid + "']", $div);
							
										$("span.stat", $row).removeClass("waiting").removeClass("save").removeClass("checked").addClass("saved");
										
										$("div.active", $row).hide("fast", function(){
											$("div.deactive", $row).show("fast");
										});
											
									});
									
									/* form element trigger */
									$("select[forField]", $div).change(function(e) {
										
										var $input = $(this);
										var rowid = $input.attr("rowid");
										var field = $input.attr("forField");
										
										var $row = $("tr.editRows[rowid='" + rowid + "']", $div);
										
										var fieldCampusID = $(":input[forField='CampusID']", $row).val();
										
										$.post(
												"<cfoutput>#buildURL('apiClassUpdate')#</cfoutput>", 
												{
													'cid' : rowid,
													'CampusID' : fieldCampusID,
													'seed': (new Date()).getTime()
												},
												function(data) {
													
													result = $.parseJSON(data);
													
													var rowid = result.formClass.ClassID;
													var $row = $("tr.editRows[rowid='" + rowid + "']", $div);

													$("div[forField='CampusID'].deactive", $row).text(result.campus.CampusName);
													
												});
										
										$("div[forField=" + field + "].active", $row).hide("fast", function(){
											$("div[forField=" + field + "].deactive", $row).show("fast");
										});
										
									});
									
									$("input[forField]", $div).blur(function(e) {
										
										var $input = $(this);
										var rowid = $input.attr("rowid");
										var field = $input.attr("forField");
										
										var $row = $("tr.editRows[rowid='" + rowid + "']", $div);
										
										var valueWas = $("div[forField=" + field + "].deactive", $row).text();
										
										/* 字段内容发生更新 */
										if (valueWas != $input.val()) {
											
											var fieldName = $(":input[forField='Name']", $row).val();
											var fieldPlanSize = $(":input[forField='PlanSize']", $row).val();
											
											$.post(
												"<cfoutput>#buildURL('apiClassUpdate')#</cfoutput>", 
												{
													'cid' : rowid,
													'Name' : fieldName,
													'PlanSize' : fieldPlanSize,
													'seed': (new Date()).getTime()
												}, 
												function(data) {
													
													result = $.parseJSON(data);
													
													var rowid = result.formClass.ClassID;
													var $row = $("tr.editRows[rowid='" + rowid + "']", $div);
													
													$("div[forField='Name'].deactive", $row).text(result.formClass.Name);
													
													$("div[forField='PlanSize'].deactive", $row).text(result.formClass.PlanSize);
													
												});
										}
										
										$("div[forField=" + field + "].active", $row).hide("fast", function(){
											$("div[forField=" + field + "].deactive", $row).show("fast");
										});
										
									});

								});
							// -->
							//]]>
						</script>
						
						<cfelse>
							<div class="systemNotice">
								<h3><span class="img icon16x16 info"></span>尚未设置行政班</h3>
								<p>当前您还没有设置<cfoutput>#rs_subject.sbj_name#</cfoutput>专业下属的行政班, 学校将根据招生计划统一进行行政班建制.</p>
							</div>
					</cfif>
					
				</div>
				
			</div>
		</li>
	</ul>
</div>